
#include "unitfactory.h"
#include "swordsman.h"
#include "archer.h"
#include "alchemist.h"
#include "miner.h"
#include "levelmanager.h"
#include "gamedatamanager.h"


UnitFactory::UnitFactory() {

}

UnitFactory::~UnitFactory() {

}

Soldier* UnitFactory::createSoldier(SoldierType type, GamePlayScene* scene) {
	Soldier *soldier = nullptr;

	Point pos = LM->getCastlePosition();
	switch (type)
	{
	case SoldierType::swordsman:
		soldier = new Swordsman();
		break;
	case SoldierType::archer:
		soldier = new Archer();
		break;
	case SoldierType::alchemist:
		soldier = new Alchemist();
		break;
	case SoldierType::miner:
		soldier = new Miner();
		break;
	default:break;
	}

	if(soldier) {
		soldier->set(SOLDIER_TYPE_NAMES[(int)type], pos, scene);
	}

	return soldier;
}

Unit* UnitFactory::createHero( const string& name , GamePlayScene* scene)
{
	return nullptr;
}
